home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_gimp.idb / usr / freeware / share / gimp / scripts / basic1-logo.scm.z / basic1-logo.scm
Encoding:
GIMP Script-Fu Script  |  1999-07-21  |  2.0 KB  |  49 lines

  1. ;  DROP-SHADOW-LOGO
  2. ;  draw the specified text over a background with a drop shadow
  3.  
  4. (define (script-fu-basic1-logo text size font bg-color text-color)
  5.   (let* ((img (car (gimp-image-new 256 256 RGB)))
  6.      (text-layer (car (gimp-text img -1 0 0 text 10 TRUE size PIXELS "*" font "*" "*" "*" "*")))
  7.      (width (car (gimp-drawable-width text-layer)))
  8.      (height (car (gimp-drawable-height text-layer)))
  9.      (bg-layer (car (gimp-layer-new img width height RGB_IMAGE "Background" 100 NORMAL)))
  10.      (shadow-layer (car (gimp-layer-new img width height RGBA_IMAGE "Shadow" 100 MULTIPLY)))
  11.      (old-fg (car (gimp-palette-get-foreground)))
  12.      (old-bg (car (gimp-palette-get-background))))
  13.     (gimp-image-disable-undo img)
  14.     (gimp-image-resize img width height 0 0)
  15.     (gimp-image-add-layer img shadow-layer 1)
  16.     (gimp-image-add-layer img bg-layer 2)
  17.     (gimp-palette-set-background text-color)
  18.     (gimp-layer-set-preserve-trans text-layer TRUE)
  19.     (gimp-edit-fill img text-layer)
  20.     (gimp-palette-set-background bg-color)
  21.     (gimp-edit-fill img bg-layer)
  22.     (gimp-edit-clear img shadow-layer)
  23.     (gimp-selection-layer-alpha img text-layer)
  24.     (gimp-palette-set-background '(0 0 0))
  25.     (gimp-selection-feather img 7.5)
  26.     (gimp-edit-fill img shadow-layer)
  27.     (gimp-selection-none img)
  28.     (gimp-palette-set-foreground '(255 255 255))
  29.     (gimp-blend img text-layer FG-BG-RGB MULTIPLY RADIAL 100 20 REPEAT-NONE FALSE 0 0 0 0 width height)
  30.     (gimp-layer-translate shadow-layer 3 3)
  31.     (gimp-layer-set-name text-layer text)
  32.     (gimp-palette-set-background old-bg)
  33.     (gimp-palette-set-foreground old-fg)
  34.     (gimp-image-enable-undo img)
  35.     (gimp-display-new img)))
  36.  
  37. (script-fu-register "script-fu-basic1-logo"
  38.             "<Toolbox>/Xtns/Script-Fu/Logos/Basic I"
  39.             "Creates a simple logo with a drop shadow"
  40.             "Spencer Kimball"
  41.             "Spencer Kimball"
  42.             "1996"
  43.             ""
  44.             SF-VALUE "Text String" "\"The Gimp\""
  45.             SF-VALUE "Font Size (in pixels)" "100"
  46.             SF-VALUE "Font" "\"Dragonwick\""
  47.             SF-COLOR "Background Color" '(255 255 255)
  48.             SF-COLOR "Text Color" '(6 6 206))
  49.